/************************************************************************/
// Copyright (C) 2016, han_gangbiao. All rights reserved.
// Use of this source code is governed by a GPL-v2 license that can be found in the License file.
// 
// [Time]:      2016-1-4 21:53:17
// [Author]:    han_gangbiao [http://my.oschina.net/jackhen]
// [Info]:      
/************************************************************************/

#include "xrefptr.h"

BEG_NS_SMART

void refobj_t::destroy()
{
	delete this;
}

long refobj_t::add_ref()
{
	return m_ref.inc();
}

long refobj_t::release()
{
	long ret = m_ref.dec();
	if(ret == 0) destroy();

	return ret;
}

END_NS_SMART
